public final class SimpleGraphIO extends java.lang.Object implements GraphReader, GraphWriter
| Constructor and Description |
|---|
SimpleGraphIO()
Empty Constructor for instantiating the class.
|
| Modifier and Type | Method and Description |
|---|---|
Graph |
parseGraph(java.io.File source,
boolean undirected)
Reads a graph from memory.
|
private static boolean |
testFile(java.io.File file)
Tests to see if a File is a valid graph file.
|
private java.lang.Integer |
verifyRelationship(java.lang.Object edgeData)
rapin001 @ 3/2020
Function to verify the edge data is an Integer
|
void |
writeGraph(Graph toWrite)
Writes graphs to memory.
|
public SimpleGraphIO()
public Graph parseGraph(java.io.File source, boolean undirected)
parseGraph in interface GraphReadersource - the File object representing the graph.undirected - a boolean indicating if the graph should be
interpreted as undirected.public void writeGraph(Graph toWrite)
writeGraph in interface GraphWritertoWrite - the Graph object to write to a file.private static boolean testFile(java.io.File file)
file - the File to test.private java.lang.Integer verifyRelationship(java.lang.Object edgeData)
edgeData - object that you want to verify the class of to be Integer